package cn.iocoder.yudao.module.common.dal.mysql.grade;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.common.dal.dataobject.grade.GradeDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.common.controller.admin.grade.vo.*;

/**
 * 年级 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface GradeMapper extends BaseMapperX<GradeDO> {

    default PageResult<GradeDO> selectPage(GradePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<GradeDO>()
                .likeIfPresent(GradeDO::getGradeName, reqVO.getGradeName())
                .likeIfPresent(GradeDO::getCreatorName, reqVO.getCreatorName())
                .betweenIfPresent(GradeDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(GradeDO::getUpdaterName, reqVO.getUpdaterName())
                .eqIfPresent(GradeDO::getVersion, reqVO.getVersion())
                .orderByDesc(GradeDO::getId));
    }

}